package inet

type Callback interface {
	OnSessionStart(session *Session)
	OnSessionEnd(session *Session)
}

type BaseSessionCallback struct {
	calls []Callback
}

func (b *BaseSessionCallback) AddCallback(callback Callback) {
	b.calls = append(b.calls, callback)
}

func (b *BaseSessionCallback) OnSessionStart(session *Session) {
	for _, i := range b.calls {
		i.OnSessionStart(session)
	}
}

func (b *BaseSessionCallback) OnSessionEnd(session *Session) {
	for _, i := range b.calls {
		i.OnSessionEnd(session)
	}
}
